export const judgeEnvir = {
	// 判断是否在微信中打开
	isWechat: (): boolean => {
		const ua = navigator.userAgent.toLowerCase();
		if (/micromessenger/i.test(ua)) {
			return true;
		}
		else {
			return false;
		}
	},

	// 判断是否在微博中打开
	isWeiBo: (): boolean => {
		const ua = navigator.userAgent.toLowerCase();
		if (/WeiBo/i.test(ua)) {
			return true;
		}
		else {
			return false;
		}
	},

	// 判断是否在QQ中打开
	isQQ: (): boolean => {
		const ua = navigator.userAgent.toLowerCase();
		if (/QQ/i.test(ua)) {
			return true;
		}
		else {
			return false;
		}
	},
	
	// 判断是否是安卓环境
	isAndroid: (): boolean => {
		const ua = navigator.userAgent.toLowerCase();
		if (ua.indexOf('android') != -1) {
			return true;
		}
		else {
			return false;
		}
	},
	
	//判断是否是IOS环境
	isIOS: (): boolean => {
		const ua = navigator.userAgent.toLowerCase();
		if (ua.indexOf('iphone') != -1) {
			return true;
		}
		else {
			return false;
		}
	}
}